***************************************************************************************************************
**	Replication do-file for "Governmment Policies and the Emergence of an Ethnic Dimension in Party Systems"
**	Author: Maayan Mor
**  APPENDIX H
***************************************************************************************************************

clear all

/* SET DIRECTORY */

use "state wide.dta", clear

**		drop those districts in which the Liberals did not compete in some elections
drop if liberal67==. | liberal70==. | liberal73==. 

*******************
** Baseline sample
*******************
local controls industry c.priest_vicar##c.priest_vicar wittenberg paris DM_t urban c.monastery##c.monastery

**		(1)

reg gap6367_lib cathp_64 `controls' 
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6367_simple

**		(2)

reg gap6770_lib cathp_64 `controls'
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6770_simple

**		(3)

reg gap6370_lib cathp_64 `controls'
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6370_simple

**		(4)

reg gap6373_lib cathp_64 `controls' 
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6373_simple


*******************************************
** Subsample-No polish territories
******************************************
keep if baseline_sample==0

local controls industry c.priest_vicar##c.priest_vicar wittenberg paris DM_t urban c.monastery##c.monastery

**		(1)

reg gap6367_lib cathp_64 `controls' 
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6367_simple_nbl

**		(2)

reg gap6770_lib cathp_64 `controls'
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6770_simple_nbl

**		(3)

reg gap6370_lib cathp_64 `controls'
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6370_simple_nbl

**		(4)

reg gap6373_lib cathp_64 `controls' 
estadd local random  "Simple" 
estadd local controls "Yes"
estadd local rsqr=round(e(r2), .01)
estadd local r2a=round(e(r2_a), .01)
eststo m6373_simple_nbl


***************************************
** export estimates for the simple OLS
***************************************

esttab m6367_simple m6770_simple m6370_simple m6373_simple  ///
using "main_regression_table_simple.tex", ///
replace  b se  obslast order(cathp_64) eqlabels(none) compress  ///
mtitles("from 63 to 67" "from 67 to 70" "from 63 to 70" "from 63 to 73") note(" ") ///
title("Change in the party alignment of Catholics 1863-1873") label ///
nobaselevels  b(%9.3f) se(%9.3f) t(%9.1f)  s(controls rsqr r2a N , ///
label("Pre-1866 covariates" "\(R^{2}\)" "Adjusted \(R^{2}\)" "Observations") fmt(%9.0f)) 

esttab m6367_simple_nbl  m6770_simple_nbl m6370_simple_nbl m6373_simple_nbl  ///
using "main_regression_table_simple_bl.tex", ///
replace  b se  obslast order(cathp_64) eqlabels(none) compress  ///
mtitles("from 63 to 67" "from 67 to 70" "from 63 to 70" "from 63 to 73") note(" ") ///
title("Change in the party alignment of Catholics 1863-1873") label ///
nobaselevels  b(%9.3f) se(%9.3f) t(%9.1f)  s(controls rsqr r2a N , ///
label("Pre-1866 covariates" "\(R^{2}\)" "Adjusted \(R^{2}\)" "Observations") fmt(%9.0f)) 

